﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<RegisterModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
	<div id="sessions-new" class="content-wrapper float-container">
		<ul id="sales-button">
			<li>
				<%=Html.ActionLink("登录","Login","Home",null,new {@class="thickbox icon logo"}) %>
			</li>
		</ul>
		<% using (Html.BeginForm())
	 { %>
		<h2>
			注册新用户</h2>
		<hr class="top-seperator" />
		<fieldset>
			<legend>用户信息</legend>
			<p>
				<%=Html.LabelFor(c => c.UserName)%>
				<%=Html.TextBoxFor(c => c.UserName)%>
			</p>
			<p>
				<%= Html.LabelFor(m => m.Email) %>
				<%= Html.TextBoxFor(m => m.Email) %>
			</p>
			<p>
				<%=Html.LabelFor(c => c.Password)%>
				<%=Html.PasswordFor(c => c.Password)%> 
			</p>
			<p>
				<%=Html.LabelFor(c => c.ConfirmPassword)%>
				<%=Html.PasswordFor(c => c.ConfirmPassword)%>
			</p>
		</fieldset>
		<div class="buttons action-buttons">
			<a class="btn large-action-btn"><span>
				<input class="" name="commit" type="submit" />注 册</span></a>
		</div>
		<%} %>
		<%= Html.ValidationSummary(true, "注册失败，请查看你输入的信息是否正确。") %>
		<div class="clear">
			<!-- force clear -->
		</div>
	</div>
	
	<%=Html.JavaScript(new {passwordLength = ViewData["PasswordLength"]}) %>

	<script type="text/javascript"> 
		$(document).ready(function() {
			$("form").validate({
				rules: {
					UserName: "required",
					Email: {
						required: true,
						email: true
					},
					Password: {
						required: true,
						minlength: passwordLength
					},
					ConfirmPassword: {
						required: true,
						minlength: passwordLength,
						equalTo: "#Password"
					}
				}
			});
		});
	</script>

</asp:Content>
